package com.qingcloud.adminbackend.entity.message;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

/**
 * 事件保存规则
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_message_event_save_rule")
public class SysMessageEventSaveRule extends Model {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "事件类型ID",example = "E1241")
    @TableField(exist = false)
    private Integer typeId;

    @ApiModelProperty(value = "事件编号",example = "E1241")
    private String eventCode;

    @ApiModelProperty(value = "默认告警等级")
    private String defaultLevel;

    @ApiModelProperty(value = "启用开始时间")
    private String startTime;

    @ApiModelProperty(value = "启用结束时间")
    private String endTime;

    @ApiModelProperty(value = "多少分钟内重复告警")
    private Integer repeatMinute;

    @ApiModelProperty(value = "计算规则")
    @TableField(exist = false)
    @Valid
    private List<SysMessageEventCalRule> calRuleList = new ArrayList<>();
}
